/*
 * Criado em Mar 21, 2005
 *
 *
 */
package vendas.dto;

import gminet.infra.dao.SimpleTransferObject;

import java.util.List;

/**
 * @author Gabriel Flores Mendes
 * 
 * 
 */
public class BuyerType extends SimpleTransferObject {

    private static final long serialVersionUID = 2808996151355813700L;

    private static final byte UNDEFINED_ID = 0;
    private static final byte BB_ID = 10;
    private static final byte CLF_ID = 20;
    private static final byte ML_ID = 50;
    private static final byte OTHER_ID = 90;

    public static final BuyerType UNDEFINED = new BuyerType(UNDEFINED_ID, "INDEFINIDO");
    public static final BuyerType BB = new BuyerType(BB_ID, "BB");
    public static final BuyerType CLF = new BuyerType(CLF_ID, "CLF");
    public static final BuyerType ML = new BuyerType(ML_ID, "ML");
    public static final BuyerType OTHER = new BuyerType(OTHER_ID, "Outros");

    static {
        Class<BuyerType> clazz = BuyerType.class;
        addObject(clazz, BB);
        addObject(clazz, CLF);
        addObject(clazz, ML);
        addObject(clazz, OTHER);
    }

    private BuyerType(int i, String str) {

        super(i, str);
    }

    @SuppressWarnings("unchecked")
    public static List<BuyerType> getList() {

        return (List<BuyerType>) getList(BuyerType.class);
    }

    public static BuyerType getBuyerTypeById(int typeId) {

        return (BuyerType) getObject(BuyerType.class, typeId);
    }

}
